﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UIManager : MonoBehaviour {

    public static UIManager Instance;
   [SerializeField]
    TalkElement talkElementPrefab;
    [SerializeField]
    private GameObject content;
    public TalkElement TalkElementPrefab
    {
        get
        {
            return talkElementPrefab;
        }

        set
        {
            talkElementPrefab = value;
        }
    }

    private void Awake()
    {
        Instance = this;
    }
    // Use this for initialization
    void Start () {
       
    }
	
	// Update is called once per frame
	void Update () {
		
	}
    public void CreatTalkElement(bool isLeft ,AudioClip clip) {
        TalkElement temp = GameObject.Instantiate(talkElementPrefab, content.gameObject.transform);
        temp.TalkContentClip = clip;
        temp.SetElement(isLeft);
        temp.gameObject.SetActive(true);
    }
}
